package com.luobu.javaee.util;

import com.luobu.javaee.domain.Document;
import com.luobu.javaee.domain.DocumentSearch;
import com.luobu.javaee.domain.dto.DocumentDto;

public class SearchUtil {
    public static DocumentSearch buildDocSearchFromDocDto(DocumentDto documentDto){
        Document document = documentDto.getDocument();
        DocumentSearch documentSearch = new DocumentSearch();
        documentSearch.setDocId(document.getId());
        documentSearch.setDocName(document.getDocName());
        documentSearch.setArchiveId(document.getArchiveId());
        documentSearch.setUserId(document.getUserId());

        return documentSearch;
    }
}
